﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LittleMonkey.Communication;

namespace LittleMonkey
{
    class Authentication:HTTPResponse
    {
        HTTP mHttp = null;
        public delegate void StatusUpdateHandler(string FOR , bool status);
        public event StatusUpdateHandler OnUpdateStatus;

        public Authentication()
        {
            mHttp = new HTTP();
        }

        public void login(string username, string password)
        {
            Dictionary<string, string> mDict = new Dictionary<string, string>();
            mDict.Add("username", username);
            mDict.Add("password", password);
            mHttp.processGet(constants.AUTH_URL, mDict, this);
         
        }
        public bool checkstatus()
        {
            return true;
        }

        public bool register(string username, string password, string email)
        {
            return false;
        }
        public void getResponse(string response)
        {
            if (OnUpdateStatus != null)
            {
                OnUpdateStatus("1", true);
            }
        }
    }
}
